package com.niit;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author： 曾渝晋
 * @date: 2021/6/16 12:20 上午
 * @description:
 * 当config bus server 执行post请求 /actuator/bus-refresh 时
 * 动态刷新服务名和端口号，通过这个，动态刷新所有客户端的配置
 * @modified:
 * @Version: 1.0
 */
@RestController
@Slf4j
@RequestMapping("/")
@RefreshScope
public class ConfigController {

    @Value("${spring.application.name}")
    private String applicationName;

    @Value("${server.port}")
    private String port;
}
